Repository navigation
feat(api): add the shared abort, timeout and error plumbing (#1311 split u0) - #2800
easonLiangWorldedtech wants to merge 1 commit into
Conversation
…-Org#1311 split u0) Unit u0 of the split plan in Zoo-Code-Org#2799. It carries the shared helpers that the provider units of Zoo-Code-Org#1311 consume, and nothing provider-specific. - abort-signal.ts: mergeAbortSignalAndTimeout, rejectOnAbort, and the timeout classification helpers (isTimeoutAbort, createTimeoutError). - error-handler.ts: handleOpenAIRequestError keeps an HTTP failure's identity over a racing abort and reports a deadline as TimeoutError. - request-timeout.ts: getRequestTimeoutMs for the per-request SDK timeout. - test-utils/errors.ts: captureError, used by the cancellation rows of the provider units. Evidence: 643 rows across the utils and test-utils specs pass; tsc --noEmit clean; eslint --prune-suppressions --max-warnings=0 clean; prettier clean.
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Fix the failing required CI checks; awaiting-maintainer requires CI and automated review completion. Review-state labels are managed by this workflow; do not edit them manually. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Changed-code mutation testingReport for PR head
Details: mutants, guidance, and reproductionChanged-code mutation testing
Focused tests
Reproduce locallyFrom a full checkout containing both commits: Mutation reports
The workflow uploads generated reports in the Advisory findings
|
Part of #2799 (split plan for #1311). Unit u0 of 4.
Scope
The shared plumbing that the provider units consume. No provider file is in this patch.
abort-signal.ts:mergeAbortSignalAndTimeout,rejectOnAbort,isTimeoutAbort,createTimeoutError.error-handler.ts:handleOpenAIRequestErrorkeeps an HTTP failure's identity over a racing abort (hasNumericHttpStatus) and reports a deadline asTimeoutError.request-timeout.ts:getRequestTimeoutMs.test-utils/errors.ts:captureError.Budget (standalone vs
dd30249147)Changed executable lines: 18 (cap 500). a+d: ~250.
Verification
tsc --noEmit: clean.eslint --prune-suppressions --max-warnings=0: clean, andsrc/eslint-suppressions.jsonmoves down (1 addition, 6 deletions).Merge order
u0 -> u1 (
split/1311-u1-openai-family) -> u2 (split/1311-u2-zai) -> u3 (split/1311-u3-kimi-code). u0 ownscreateAbortError,mergeAbortSignalAndTimeout,isTimeoutAbort,rejectOnAbort,bridgeExternalAbortSignal,hasNumericHttpStatusandcreateTimeoutError; every later unit consumes them and adds no copy.